#ifndef MobileStorageWIDGET_H
#define MobileStorageWIDGET_H

#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
#include "fileinfo.h"

#include "mobilestorageviewwidget.h"

class MobileStorageWidget : public QWidget
{
    Q_OBJECT
public:
    MobileStorageWidget(const QMap<QString, FileInfo> &listStruct, QString tabBarPath, QWidget *parent = nullptr);
    ~MobileStorageWidget();

    void setMode(QListView::ViewMode mode);

public:
private Q_SLOTS:
    void slotModeButtonClicked();
    void slotFileName(QString fileNamePath);
    void slotLocalPathList(const QStringList &localPathList);
    void slotMenuFileName(QString fileName);
Q_SIGNALS:
    void sigFileName(QString fileNamePath);
    void sigShowMobileStorage();
    void sigCurrentIndexPath(QString currentIndexPath);
    void sigShowCopyButtonWidget();
    void sigHideCopyToComputerWidget();
    void sigSelectDataList(const QList<FileInfo> &fileList);
    void sigLocalPathList(const QStringList &localPathList);
    void sigUpdateClicked(QString);
    void sigModeChange(QListView::ViewMode);
    void sigMenuFileName(QString fileName);
    void sigSetLastWidget();
    void sigUpdateSearchClicked();

private:
    MobileStorageViewWidget *m_mobileStorageViewWidget = nullptr;
    QPushButton *m_modeButton = nullptr;
    QListView::ViewMode m_mode = QListView::IconMode;
    //面包屑的标题路径
    QString m_tabBarPath;
    QMap<QString, FileInfo> m_listStruct;
    QString m_currentIndexPath;

private:
    void initUI();
    void initSearchUI();
    void initConnect();
};

#endif // MobileStorageWIDGET_H
